<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
		<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
		<html>
		<head>
			<title>数据字典</title>
			<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
			<jsp:include page="/WEB-INF/views/include/newhead.jsp" />
			<%@include file="/WEB-INF/views/include/treeview.jsp"%>
		</head>
		<body class="childrenBody site-block">
			<header class="larry-personal-tit">
				<span>
				    <!-- dict 将user对应替换 -->
					<c:if test="${empty user.id}">新增</c:if>
					<c:if test="${not empty user.id}">修改</c:if>
				</span>
			</header>
			
			<div class="mainCon">
				<form:form id="inputForm" autocomplete="off" modelAttribute="dict" action="${ctx}/sys/dict/save" method="post">
					<form:hidden path="id"/>
					<sys:message content="${message}"/>
							<div class="layui-form-item">
							   <div class="layui-inline">
									<label class="layui-form-label">键值</label>
									<div class="layui-input-inline">
											<form:input path="value" placeholder="请输入键值"  maxlength="128" class="layui-input"/>
									</div>
							   </div>
							   <div class="layui-inline">
									<label class="layui-form-label">标签</label>
									<div class="layui-input-inline">
											<form:input path="label" placeholder="请输入标签"  maxlength="128" class="layui-input"/>
									</div>
							   </div>
							</div>
							

							<div class="layui-form-item">
							    <div class="layui-inline">
									<label class="layui-form-label">类型</label>
									<div class="layui-input-inline">
											<form:input path="type" placeholder="请输入类型"  maxlength="128" class="layui-input"/>
									</div>
								</div>
								<div class="layui-inline">
									<label class="layui-form-label">描述</label>
									<div class="layui-input-inline">
											<form:input path="description" placeholder="请输入描述"  maxlength="128" class="layui-input"/>
									</div>
							   </div>
							</div>
							
							<div class="layui-form-item">
							   <div class="layui-inline">
									<label class="layui-form-label">排序</label>
									<div class="layui-input-inline">
											<form:input path="sort" placeholder="请输入排序"  maxlength="128" class="layui-input"/>
									</div>
								</div>
							</div>
					
					<div class="layui-form-item bottom_xf" style="margin-top: 50px">
						<div class="layui-input-block input500">
							<button type="button" class="layui-btn layui-btn-primary" onclick="window.history.go(-1);">返回</button>
							<button class="layui-btn" type="submit">保存</button>
							<button onclick="formReset();" type="button"  class="layui-btn layui-btn-danger">重置</button>
						</div>
					</div>
				</form:form>
			</div>
			
			<script type="text/javascript">
				$(document).ready(function() {
					$("#inputForm").validate({
						submitHandler: function(form){
							loading('正在提交，请稍等...');
							form.submit();
						},
					/**	在做异步验证的时候需要添加
					    rules: {
						
						},
						messages: {
						
						}, */
						errorContainer: "#messageBox",
						errorPlacement: function(error, element) {
							$("#messageBox").text("输入有误，请先更正。");
							if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
								error.appendTo(element.parent().parent());
							} else {
								error.insertAfter(element);
							}
						}
					});
				});
			</script>
		</body>
		</html>